<!DOCTYPE html>
<html lang="zh" xmlns:th="http://www.thymeleaf.org" >
<head>
    <th:block th:include="include :: header('新增知识产权')" />
    <th:block th:include="include :: datetimepicker-css" />
    <th:block th:include="include :: select2-css"/>
</head>
<body class="white-bg">
    <div class="wrapper wrapper-content animated fadeInRight ibox-content">
        <form class="form-horizontal m" id="form-property-add">
            <div class="form-group">    
                <label class="col-sm-3 control-label is-required">所属企业：</label>
                <div class="col-sm-8">
                     <select name="compId" id="compId" class="form-control" required>
                         <option value="">--请选择--</option>
                         <option  th:each="a:${companyList}" th:text="${a.compName}"
                                  th:value="${a.compId}" th:selected="${compId eq a.compId}"></option>
                     </select>
                </div>
            </div>
            <div class="form-group">    
                <label class="col-sm-3 control-label is-required">知识产权名称：</label>
                <div class="col-sm-8">
                    <input name="iproName" class="form-control" type="text" required>
                </div>
            </div>
            <div class="form-group">    
                <label class="col-sm-3 control-label">知识产权代码：</label>
                <div class="col-sm-8">
                    <input name="iproCode" class="form-control" type="text">
                </div>
            </div>
            <div class="form-group">    
                <label class="col-sm-3 control-label is-required">知识产权类别：</label>
                <div class="col-sm-8">
                    <div class="radio-box" th:each="dict : ${@dict.getType('intellectual_property_type')}">
                        <input type="radio" th:id="${'iproType_' + dict.dictCode}" name="iproType" th:value="${dict.dictValue}" th:checked="${dict.default}" required>
                        <label th:for="${'iproType_' + dict.dictCode}" th:text="${dict.dictLabel}"></label>
                    </div>
                </div>
            </div>
            <div class="form-group">    
                <label class="col-sm-3 control-label is-required">获得时间：</label>
                <div class="col-sm-8">
                    <div class="input-group date">
                        <span class="input-group-addon"><i class="fa fa-calendar"></i></span>
                        <input name="getTime" class="form-control" placeholder="yyyy-MM-dd" type="text" required>
                    </div>
                </div>
            </div>
             <div class="form-group">    
                <label class="col-sm-3 control-label">备注：</label>
                <div class="col-sm-8">
                     <textarea type="text" name="remark" class="form-control" placeholder="请输入备注"></textarea>
                </div>
            </div>
        </form>
    </div>
    <th:block th:include="include :: footer" />
    <th:block th:include="include :: datetimepicker-js" />
    <th:block th:include="include :: select2-js"/>
    <script type="text/javascript">
        var prefix = ctx + "system/property"
        $("#form-property-add").validate({
            focusCleanup: true
        });

        function submitHandler() {
        	console.log($('#form-property-add').serialize());
            if ($.validate.form()) {
                $.operate.save(prefix + "/add", $('#form-property-add').serialize());
            }
        }

        $("input[name='getTime']").datetimepicker({
            format: "yyyy-mm-dd",
            minView: "month",
            autoclose: true
        });
    </script>
</body>
</html>